package com.power.sifa.approve.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  表单绑定生成材料文件版本记录实体类
*/

@Entity
@ApiModel(value="表单绑定生成材料文件版本记录")
@Data
@Table(name="Aprv_materials_options_version",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Builder
@AllArgsConstructor
//@IdClass(Aprv_materials_options_version.Aprv_materials_options_versionPK.class) 用于复合组件
public class Aprv_materials_options_version extends BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "表单记录id")
    private String optionid;

    @ApiModelProperty(value = "修改人")
    private String userid;

    @ApiModelProperty(value = "修改记录")
    private String username;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createtime;

    @ApiModelProperty(value = "入参表单")
    private String docfiled;

    @ApiModelProperty(value = "版本")
    private Integer version;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("optionid", this.getOptionid());
        map.put("userid", this.getUserid());
        map.put("username", this.getUsername());
        map.put("createtime", this.getCreatetime());
        map.put("docfiled", this.getDocfiled());
        map.put("version", this.getVersion());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Aprv_materials_optionsPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Aprv_materials_optionsPK pk = (Aprv_materials_optionsPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}